{block name="circle_layout"}
	{include file="common:common_layout"}
{/block}
{extend name="common/layout" /}
{block name="style"}{/block}
{block name="content"}
<link rel="stylesheet" href="__PLUGS_PATH__/layui_2.0/css/layui.css">
<div class="homepage warp-all">
  <div class="layout-l">
    <div class="focus-banner flexslider">
      <ul class="slides">
        <?php if(!empty($loginpic) && is_array($loginpic)){?>
        <?php foreach($loginpic as $val){?>
        <li><a href="<?php if($val['url'] != ''){echo $val['url'];}else{echo 'javascript:void(0);';}?>" target="_blank"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_CIRCLE.'/'.$val['pic'];?>"></a></li>
        <?php }?>
        <?php }?>
      </ul>
    </div>
  </div>
  <div class="layout-r">
    <?php if(session('is_login') == 0){?>
    <dl class="member-no-login">
      <dd class="avatar"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_COMMON.'/'.sysconf('default_user_portrait');?>" /> </dd>
      <dd class="welcomes">您好,欢迎来到<strong><?php echo sysconf('circle_name');?></strong></dd>
      <dd class="quick-link"> 如果您已经是会员请<a href="javascript:void(0);" nctype="login" class="url">[登录]</a>后进行操作<br/>
        或现在就<a href="{:url('member/login/register')}?ref_url={:getRefUrl()}" class="url">[注册]</a>成为会员。</dd>
    </dl>
    <?php }else{?>
    <dl class="member-me-info">
      <dt class="member-name"><?php echo session('member_name');?></dt>
      <dd class="avatar"><img src="<?php echo session('avatar')?session('avatar'):'__UPLOAD_PATH__/shop/common/default_user_portrait.gif';?>" /><a href="<?php echo url('member/information/avatar');?>" title="修改头像">修改头像</a></dd>
      <dd class="welcomes"> 欢迎回到<?php echo sysconf('circle_name');?></dd>
      <dd class="go-btn"><a target="_blank" href="{:url('pcenter/index')}">进入个人中心</a></dd>
      <dd class="quick-link"> <a target="_blank" href="{:url('pcenter/my_group')}" class="url">我的圈子</a> <a href="{:url('pcenter/index')}" class="url">我的帖子 {if condition='$new_msg neq 0'}<span style="color: red;">（消息<?php echo $new_msg;?>）</span>{/if}</a> <a href="<?php echo url('member/login/logout');?>" class="url">退出</a> </dd>
    </dl>
    <?php }?>
    <?php if(!empty($hot_themelist)){ $array = array_slice($hot_themelist, 0, 5); ?>
    <div class="group-theme-list">
      <ul>
        <?php foreach($array as $val){?>
        <li><span>[<?php echo ($val['thclass_name'] != ''?$val['thclass_name']:'默认');?>]</span><a href="{:url('theme/theme_detail',array('c_id'=>$val['circle_id'],'t_id'=>$val['theme_id']))}" title="<?php echo $val['theme_name'];?>"><?php echo $val['theme_name'];?></a></li>
        <?php }?>
      </ul>
    </div>
    <?php }?>
    <div class="new-group"><a href="javascript:void(0);" nctype="create_circle"><i></i>创建我的新圈子</a></div>
  </div>
  <?php if(!empty($circle_list)){?>
  <div class="warp-all hot-group clearfix">
    <div class="title">
      <h3><i></i>热门圈子</h3>
              <form act='search' action="{:url('circle/Search/search')}" method="get"  id="top_search_form" style="padding-top: 5px;    float: left;margin-left: 30px;">
                  <input type="text" name="title" id ="title" style="display: inline-block;" required lay-verify="required" placeholder="请输入圈子名称" autocomplete="off" class="layui-input"> 
                  <input type="submit" style="display: inline-block;" id="button" value="搜索" class="input-submit">
        </form>

    </div>
    <div class="content">
      <ul class="group-list">
        <?php foreach ($circle_list as $val){?>
        <li>
          <dl>
            <dt class="group-name">
              <h4><a href="{:url('circle/group/index',array('c_id'=>$val['circle_id']))}"><?php echo $val['circle_name'];?></a></h4>
            </dt>
            <dd class="group-pic"><a href="{:url('circle/group/index',array('c_id'=>$val['circle_id']))}"><img src="<?php echo circleLogo($val['circle_id']);?>" /></a></dd>
            <dd class="group-stat"><span><em><?php echo $val['circle_thcount'];?></em>话题&nbsp;(<i title="新话题"><?php echo intval($nowthemecount_array[$val['circle_id']]['count']);?></i>)</span><span><em><?php echo $val['circle_mcount'];?></em>组员&nbsp;(<i title="新成员"><?php echo intval($nowjoincount_array[$val['circle_id']]['count']);?></i>)</span></dd>
            <dd class="group-intro" title="<?php if($val['circle_desc'] != ''){ echo $val['circle_desc'];}else{echo '不相识的你我却拥有相同的爱好，圈子让我们距离更近:)';}?>">
              <?php if($val['circle_desc'] != ''){ echo $val['circle_desc'];}else{echo '不相识的你我却拥有相同的爱好，圈子让我们距离更近:)';}?>
            </dd>
          </dl>
          <?php if(!empty($val['theme_list'])){?>
          <ul class="new-theme">
            <?php foreach ($val['theme_list'] as $v){?>
            <li>
              <dl>
                <dt class="theme-title"><a href="{:url('circle/theme/theme_detail',array('c_id'=>$v['circle_id'],'t_id'=>$v['theme_id']))}" title="<?php echo $v['theme_name'];?>"><?php echo $v['theme_name'];?></a></dt>
                <dd class="member-avatar-s"><img src="<?php echo $v['member_avatar'];?>"/></dd>
                <dd class="theme-intro"><a href="javascript:void(0)" class="member-name" title="<?php echo $v['member_name'];?>"><?php echo $v['member_name'];?></a><span class="date"><?php echo @date('Y-m-d H:i', $v['theme_addtime']);?></span></dd>
              </dl>
            </li>
            <?php }?>
          </ul>
          <?php }?>
        </li>
        <?php }?>
      </ul>
    </div>
  </div>
  <?php }?>
  <div class="warp-all recommend-group">
    <div class="title">
      <h3><i></i>推荐圈子</h3>
      <div class="group-class-nav">
        <?php if(!empty($class_list)){?>
        <?php foreach ($class_list as $val){?>
        <a href="{:url('circle/search/group',array('class_id'=>$val['class_id'],'class_name'=>$val['class_name']))}"><?php echo $val['class_name'];?></a>
        <?php }?>
        <?php }?>
      </div>
    </div>
    <div class="content">
      <ul id="mycarousel1" class="jcarousel-skin-tango">
        <?php if(!empty($rcircle_list)){?>
        <?php foreach($rcircle_list as $val){?>
        <li title="<?php echo $val['circle_name'];?>"><img src="<?php echo circleLogo($val['circle_id']);?>" /><a href="{:url('circle/group/index',array('c_id'=>$val['circle_id']))}">
          <p class="extra"><?php echo $val['circle_name'];?></p>
          </a> </li>
        <?php }?>
        <?php }?>
      </ul>
    </div>
  </div>
  <div class="warp-all">
    <div class="layout-l">
      <div class="recommend-theme">
        <div class="title">
          <h3>推荐话题</h3>
        </div>
        <div class="content">
          <ul class="recommend-theme-list">
            <?php if(!empty($theme_list)){?>
            <?php foreach($theme_list as $val){?>
            <li>
              <dl>
                <dt class="theme-title" title="<?php echo $val['theme_name'];?>"><a href="{:url('theme/theme_detail',array('c_id'=>$val['circle_id'],'t_id'=>$val['theme_id']))}"><?php echo $val['theme_name'];?></a></dt>
                <!--<dd class="thumb"><a href="{:url('theme/theme_detail',array('c_id'=>$val['circle_id'],'t_id'=>$val['theme_id']))}"><img src="<?php echo $val['affix'];?>" class="t-img" /></a></dd>-->
                <dd class="group-name" title="来自<?php echo $val['circle_name'];?>">来自<a href="{:url('circle/group/index',array('c_id'=>$val['circle_id']))}"><?php echo $val['circle_name'];?></a></dd>
              </dl>
            </li>
            <?php }?>
            <?php }?>
          </ul>
          <div class="clear"></div>
        </div>
       <!--  <div class="title">
         <h3>圈友晒单</h3>
       </div> -->
<!--         <div class="content show-goods">
  <?php if(!empty($gtheme_list)){?>
  <?php foreach ($gtheme_list as $val){?>
  <dl>
    <dt class="theme-title" title="<?php echo $val['theme_name'];?>"><a href="{:url('theme/theme_detail',array('c_id'=>$val['circle_id'],'t_id'=>$val['theme_id']))}"><?php echo $val['theme_name'];?></a></dt>
    <dd class="theme-info"><a href="javascript:void(0)" class="member-name" title="<?php echo $val['member_name'];?>"><?php echo $val['member_name'];?></a><span class="group-name">来自<a href="{:url('group/index',array('c_id'=>$val['circle_id']))}" title="<?php echo $val['circle_name'];?>"><?php echo $val['circle_name'];?></a></span>
    <dd class="member-avatar"><img src="<?php echo $val['member_avatar'];?>"/></dd>
    <?php if(!empty($thg_list[$val['theme_id']])){?>
    <dd class="goods-list">
      <ul>
        <?php foreach($thg_list[$val['theme_id']] as $val){?>
        <li class="thumb"><a href="<?php echo $val['thg_url'];?>"><img src="<?php echo $val['image'];?>" class="t-img" /></a></li>
        <?php }?>
      </ul>
    </dd>
    <?php }?>
  </dl>
  <?php }?>
  <?php }?>
</div> -->
      </div>
    </div>
    <div class="layout-r">
     <!--  <div class="good-member clearfix">
       <div class="title">
         <h3>优秀圈成员...</h3>
       </div>
       <?php if(!empty($one_member)){?>
       <div class="contnet special">
         <dl class="member-info">
           <dt class="name"><a href="javascript:void(0)"><?php echo $one_member['member_name'];?></a></dt>
           <dd class="avatar thumb"><a href="javascript:void(0)"><img src="<?php echo getMemberAvatarForID($one_member['member_id']);?>"  class="t-img"/></a></dd>
           <dd class="group">来自<a href="{:url('group/index',array('c_id'=>$one_member['circle_id']))}"><?php echo $one_member['circle_name'];?></a></dd>
           <dd class="intro"><?php echo $one_member['cm_intro'];?></dd>
           <?php if(!empty($one_membertheme)){?>
           <dd class="theme">
             <ul>
               <?php foreach ($one_membertheme as $val){?>
               <li><a href="{:url('theme/theme_detail',array('c_id'=>$val['circle_id'],'t_id'=>$val['theme_id']))}"><span>[<?php echo ($val['thclass_name'] != ''?$val['thclass_name']:'默认');?>]</span><?php echo $val['theme_name'];?></a></li>
               <?php }?>
             </ul>
           </dd>
           <?php }?>
         </dl>
       </div>
       <?php }?>
       <?php if(!empty($more_membertheme)){?>
       <div class="contnet normal">
         <?php foreach ($more_membertheme as $val){?>
         <dl class="member-info">
           <dt class="member-name"><a href="javascript:void(0)"><?php echo $val['member_name'];?></a></dt>
           <dd class="avatar"><a href="javascript:void(0)"><img src="<?php echo $val['member_avatar'];?>"/></a></dd>
           <dd class="theme"><a href="{:url('theme/theme_detail',array('c_id'=>$val['circle_id'],'t_id'=>$val['theme_id']))}"><span>[<?php echo ($val['thclass_name'] != ''?$val['thclass_name']:'默认');?>]</span><?php echo $val['theme_name'];?></a></dd>
         </dl>
         <?php }?>
       </div>
       <?php }?>
     </div> -->
      {include file="circle:index:themetop" /}
    </div>
  </div>
</div>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jcarousel/jquery.jcarousel.min.js" charset="utf-8"></script> 
<!-- 引入幻灯片JS --> 
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.flexslider-min.js"></script> 
<script>
$(function(){
// 绑定幻灯片事件 
	$('.flexslider').flexslider();
	//图片轮换
    	$('#mycarousel1').jcarousel({visible: 8,itemFallbackDimension: 300});

	//横高局中比例缩放隐藏显示图片
	$(window).load(function () {
		$(".recommend-theme-list .t-img").VMiddleImg({"width":145,"height":96});
		$(".good-member .t-img").VMiddleImg({"width":140,"height":96});
		$(".show-goods .t-img").VMiddleImg({"width":30,"height":30});
	});
});
$(function() {
	$(".tabs-nav > li > a").mouseover(function(e) {
	if (e.target == this) {
		var tabs = $(this).parent().parent().children("li");
		var panels = $(this).parents('.theme-top:first').find(".tabs-panel");
		var index = $.inArray(this, $(this).parent().parent().find("a"));
		if (panels.eq(index)[0]) {
			tabs.removeClass("tabs-selected")
				.eq(index).addClass("tabs-selected");
			panels.addClass("tabs-hide")
				.eq(index).removeClass("tabs-hide");
		}
	}
	});
});
</script> 
{/block}